<html>
	<link rel="stylesheet" type="text/css" href="doc.css" />
	<head>
		<script type="text/javascript">
	function toggleBox(id){
		if (document.getElementById(id).style.display == "") {
			show = "none";
		} else {
			show = "";
		}
		document.getElementById(id).style.display = show;
	}
</script>
</head>
	<body>
		<h1><u>User Guide</u></h1>
		<h2>1. System and hardware information</h2>
			<p>This assembler was designed to operate on the FFA(Final Four Accelerated) Computer which has the following specifications:</p>
			<ul>
				<li>Dallas 6.6 9.8 GHz Processor</li>
				<li>1024 words of memory where one word is 16 bits</li>
				<li>A data-stack for data created during the program</li>
				<li>A test-stack for comparison results</li>
				<li>Arithmetic unit uses two's compliment</li>
				<li>Numbers use the most significant bit as the sign giving a range of -32768 to 32767</li>
				<li>Characters take 8 bits which allows for up to 2 characters per word</li>
			</ul>
		
		
		<h2>2. Installing and running</h2>
		<p>The following guides will help with installing and successfully running the assembler program, 
		linker, and simulator: </p>
			<a href="installation_guide.html"><font size=5>Installation Guide</font></a><br>
			<a href="running_guide.html"><font size=5>Running Guide</font></a>
			
		<h2>3. Instructions, operations, and directives</h2>
		<p>Instructions allow you to interact with memory and hardware through mnemonic keywords.<br>
		Directives allow you to interact with the assembler itself to do things such as start/stop the program
		and put a user created variable into memory.</p>
		<p>The following links give usage information on the available commands for the FFA's assembly language:</p>
		<a href="ref/instructions.html"><font size=5>Instructions/Functions</font></a><br>
		<a href="ref/directives.html"><font size=5>Directives</font></a><br>
		<p>*One small note: though all documentation for instructions/directives shows uppercase, lowercase is also acceptable.</p>
		
		<h2>4. Formats and restrictions</h2>
		<p>There are a few format styles/restriction on various components of the assembler:</p>
		<ul>
			<li>numbers can range from -32768 to 32767</li>
			<li>strings should not attempt to break the parser (e.x. """" is not allowed)</li>
			<li>literals can range from -512 to 511</li>
			<li>restricted EQU to op field only</li>
			<li>disallowed using external reference before they are declared</li>
			<li>tabs only for spacing between instruction, labels, etc.</li>
		</ul>
		
		<h2>5. Input and output</h2>
		<p>Input comes in the form of a source code file that will be checked 
		for validity. Valid input consists of the instructions and directives 
		above placed into a source file program while following the restrictions 
		and formats dicussed in this guide.&nbsp; The format for a line of code 
		is as follows:<br><br>Label&nbsp;&nbsp;&nbsp; Function&nbsp;&nbsp;&nbsp; 
		Operation,Operand(s)&nbsp;&nbsp;&nbsp; : Comment (begins with a colon)<br>
		<br>for example:<br>AB&nbsp;&nbsp;&nbsp; SOPER&nbsp;&nbsp;&nbsp; SUB,7&nbsp;&nbsp;&nbsp; 
		: pop and subtract 7 times, push result</p>
		
		<p>Output consists of three basic sections: Assembler report, symbol table, 
		and object file.&nbsp; The assembler report includes information about 
		each line including LC, hex code, relocation flag (a,r,m), line number, 
		and the source line itself.&nbsp; Next, the symbol table is displayed, 
		containing all labels and EQU values in the 
		input file.&nbsp; Finally, the object file is displayed, which is a 
		consice representation of all linking, text, and modification records 
		that will later be interpreted by the linker and loader prior to 
		simulation.&nbsp; <br><br>*Note - the object file is also written to a 
		seperate file, named as a parameter upon running the assembler.</p>
		<a href="javascript:toggleBox(1)">+Example Input</a>
		<pre id="1" style="display: none;">
ALT3	Start 0		:start of program	Example first line of program which consists of a label, a directive with address, and a comment.
STACK	PUSH,AB	:place AB on stack	Example of instruction with an operation using a symbolic reference
STACK	PUSH,CD	:place CD on stack	Example of instruction with an operation using a symbolic reference
SOPER	WRITE,2	:print out top 2 stack elements		Example of instruction with an operation</pre>
		<br>
		<a href="javascript:toggleBox(2)">+Test Plan Input</a>
		<pre id="2" style="display: none;">
Label_Test	sTArt	10
JUMP	=,AB
Jump	=,12	:jump
STACK	CNTL	GOTO,Pop	:branch to Pop
jump	JUMP 	^=,CD
JUMP	^=,96	: keep jumping
jump3	JUMP	<,cool
GOTO	JUMP	<,100
Pop	STACK	Push,SOPER	:Push Soper onto Stack
CD	JUMP	>,EF
JUMP	>,098
jump5	JUMP	<=,G989H	:jump some more
JUMP	<=,77
AB	JUMP	>=,62
SOPER	SOPER	ADD,22
JUMP	>=,jump
cool	JUMP	tnull,AB
JUMP	tnull,45
G989H	JUMP	dnull,AB	:almost there
JUMP	dnull,45
EF	Jump	tnull,Pop
Add	CNTL	HALT
MOPER	CNTL	HALT
: is this a blank line?
	end	Label_Test
</pre>
		<br>
		<a href="javascript:toggleBox(3)">+Test Plan Output</a>
		<pre id="3" style="display: none;">
Beginning of Assembler Report
LC Hex ARM Line Source Line
0 1 Label_Test sTArt 10
A 4016 R 2 JUMP =,AB
B 400C A 3 Jump =,12 :jump
C 2011 R 4 STACK CNTL GOTO,Pop :branch to Pop
D 4812 R 5 jump JUMP ^=,CD
E 4860 A 6 JUMP ^=,96 : keep jumping
F 5019 R 7 jump3 JUMP &lt;,cool
10 5064 A 8 GOTO JUMP &lt;,100
11 2817 R 9 Pop STACK Push,SOPER :Push Soper onto Stack
12 581D R 10 CD JUMP &gt;,EF
13 5862 A 11 JUMP &gt;,098
14 601B R 12 jump5 JUMP &lt;=,G989H :jump some more
15 604D A 13 JUMP &lt;=,77
16 683E A 14 AB JUMP &gt;=,62
17 8016 A 15 SOPER SOPER ADD,22
18 680D R 16 JUMP &gt;=,jump
19 7016 R 17 cool JUMP tnull,AB
1A 702D A 18 JUMP tnull,45
1B 7816 R 19 G989H JUMP dnull,AB :almost there
1C 782D A 20 JUMP dnull,45
1D 7011 R 21 EF Jump tnull,Pop
1E 0000 R 22 Add CNTL HALT
Error: must be a valid defined label or a number in the range of 0 to 1023.
1F 0000 R 23 MOPER CNTL HALT
Error: must be a valid defined label or a number in the range of 0 to 1023.
0 24 : is this a blank line?
20 25 end Label_Test


Symbol                           LC   Relocation  Usage    EQU String  
------                           --   ----------  -----    ---------- 
AB                               16   A           Label    n/a 
Add                              1E   R           Label    n/a 
CD                               12   R           Label    n/a 
EF                               1D   R           Label    n/a 
G989H                            1B   R           Label    n/a 
GOTO                             10   A           Label    n/a 
Label_Test                       0    A           PgmName  n/a 
MOPER                            1F   R           Label    n/a 
Pop                              11   R           Label    n/a 
SOPER                            17   A           Label    n/a 
STACK                            C    R           Label    n/a 
cool                             19   R           Label    n/a 
jump                             D    R           Label    n/a 
jump3                            F    R           Label    n/a 
jump5                            14   R           Label    n/a 


Object File
H:Label_Test:000A:0017:000A:2011135,16,04,06:0001:0018:0000:0016:0000:FFA-ASM:Label_Test
T:000A:4016:R:0:Label_Test
T:000B:400C:A:0:Label_Test
T:000C:2011:R:0:Label_Test
T:000D:4812:R:0:Label_Test
T:000E:4860:A:0:Label_Test
T:000F:5019:R:0:Label_Test
T:0010:5064:A:0:Label_Test
T:0011:2817:R:0:Label_Test
T:0012:581D:R:0:Label_Test
T:0013:5862:A:0:Label_Test
T:0014:601B:R:0:Label_Test
T:0015:604D:A:0:Label_Test
T:0016:683E:A:0:Label_Test
T:0017:8016:A:0:Label_Test
T:0018:680D:R:0:Label_Test
T:0019:7016:R:0:Label_Test
T:001A:702D:A:0:Label_Test
T:001B:7816:R:0:Label_Test
T:001C:782D:A:0:Label_Test
T:001D:7011:R:0:Label_Test
T:001E:0000:R:0:Label_Test
T:001F:0000:R:0:Label_Test
E:Label_Test</pre>
<h2>6. Errors and potential solutions</h2>
<p>A list of errors that can be caused by a users source code/program.  This list also contains potential fixes to the errors found: </p>
<a href="error_table.html"><font size=5>Error Table</font></a>
		
		</body>
</html>
